<?php
    $ex_data = $data[rand(0,count($data)-1)];
    if(!isset($ex_data["id"])){
        $ex_data = $data[rand(0,count($data)-1)];
    }
    $html = mysql_escape_string($this->renderPartial("application.views.tool.tpl_display_code",array("item"=>$ex_data,"type"=>$type_display,"radio"=>0,"layout"=>$layout,"user"=>$user),true));
    $html = Common::sanitize_output($html);  
?>
document.write('<?php echo $html;?>');